home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 486 < prev    next >
Encoding:
Text File  |  1996-08-06  |  1.4 KB  |  46 lines

  1. Path: engnews1.Eng.Sun.COM!taumet!clamage
  2. From: Igor Boukanov <igor.boukanov@fi.uib.no>
  3. Newsgroups: comp.std.c++
  4. Subject: ? about friend templates.
  5. Date: 15 Feb 1996 15:42:55 GMT
  6. Organization: University of Bergen, Norway
  7. Approved: clamage@eng.sun.com (comp.std.c++)
  8. Message-ID: <31234C10.121E@fi.uib.no>
  9. NNTP-Posting-Host: taumet.eng.sun.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset="iso-8859-2"
  12. Content-Transfer-Encoding: 7bit
  13. X-Nntp-Posting-Host: afrodite.fi.uib.no
  14. X-Mailer: Mozilla 2.0 (X11; I; HP-UX A.09.05 9000/720)
  15. X-Lines: 22
  16. Content-Length: 560
  17. Originator: clamage@taumet
  18.  
  19. How have I to declare according to the standard template class to be 
  20. a friend of non template class? I suppose it should be done in the next
  21. way:
  22.  
  23. template<class T> class template_class{
  24.    ...
  25. };
  26.  
  27. class simple_class{
  28.    friend template<class T> class template_class;
  29.    // or template<class T> friend class template_class ?;
  30.    ...
  31. };
  32.  
  33.    And the question is that g++ and DEC C++ for OSF generate errors in
  34. such lines. 
  35.  
  36. P.S.
  37.    This is modified version of my message posted to comp.lang.c++.
  38.  
  39. -- 
  40. With best regards, Igor Boukanov (igor.boukanov@fi.uib.no).
  41.  
  42. [ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  43.   Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy is
  44.   summarized in http://reality.sgi.com/employees/austern_mti/std-c++/policy.html
  45. ]
  46.